package com.cn.pw.frame.service.impl;

import org.apache.log4j.Logger;

import com.cn.pw.frame.dao.UserDao;
import com.cn.pw.frame.dao.entity.User;
import com.cn.pw.frame.service.LoginService;

public class LoginServiceImpl implements LoginService {

	private static final Logger log = Logger.getLogger(LoginServiceImpl.class);
	
	private UserDao userDao;

	@Override
	public boolean doLogin(User user) {

//		log.info("User is : " + user.getUserName());
		boolean flag = false;
//		if ("andy".equals(user.getUserName())
//				&& "123456".equals(user.getPassword())) {
//			flag = true;
//		}
//		
//		com.cn.pw.frame.dao.entity.User userEntity = new com.cn.pw.frame.dao.entity.User();
//		/*userEntity.setName(user.getUserName());
//		userEntity.setPassword(user.getPassword());*/
//		com.cn.pw.frame.dao.entity.User userDB = userDao.findUser(userEntity);
//		if(userDB != null){
//			flag = true;
//		}
		return flag;
	}

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

}
